package org.activequant.data.retrieval;

import org.activequant.core.domainmodel.marketscanner.MarketScan;
import org.activequant.core.domainmodel.marketscanner.ScanCriteria;

/**
 * Interface for a MarketScan live data feed.<br>
 * An interface. Defines the following methods:
 * <ul>
 * <li>ISubscription&lt;MarketScan&gt; subscribe(ScanCriteria spec) throws Exception;</li>
 * <li>ISubscription&lt;MarketScan&gt;[] getSubscriptions();</li>
 * </ul>
 * <br>  
 * <b>History:</b><br>
 *  - [23.10.2007] Created based on Mike Kroutikov's code + IDataSource (Erik Nijkamp)<br>
 *  
 *  @author Mike Kroutikov
 *  @author Erik Nijkamp
 *
 */
public interface IMarketScanSubscriptionSource {

	/**
	 * Subcribes a new MarketScan subscription for a specific scan criteria.
	 * @param spec
	 * @param timeFrame
	 * @return
	 * @throws Exception
	 */
	IMarketScanSubscription<MarketScan> subscribe(ScanCriteria spec) throws Exception;

	/**
	 * Returns collection of current subscriptions (excluding the canceled ones).
	 *
	 * @return subscriptions.
	 */
	IMarketScanSubscription<MarketScan>[] getSubscriptions();
	
	void reconnect();

}